window.LocalSearch = function(pointOperator,div){
	//this.gSearch = gSearch;
	this.pointOperator = pointOperator;
	
	if(div){
		this.uiDiv = div;
		this.init();
	}
}

window.LocalSearch.prototype = {
	init:function(){
		this.initUI();
	},
	
	initUI:function(){
		var me = this;
		var root = $("#"+this.uiDiv);
		var keyword = this.inputKeyword = $("<input id='searchKeyword' type='text'></input>");
		keyword.keydown(function(s){
			alert(s);
		});
		this.inputKeyword.appendTo(root);
		this.searchImg = $("<img id='searchimg' alt='点击进行搜索' src='image/08.png'></img>");
		this.searchImg.appendTo(root);
		this.searchImg.click(function(){
			me.search();
		});
	},
	
	search:function(keyword){
      	var keyword = keyword||this.inputKeyword.val();
      	var filter = {type:"match",value:keyword};
      	this.pointOperator.query(filter);
	}
};